

#ifndef WINDOW_MANAGER
#define WINDOW_MANAGER

#include "logger.h"
#include <X11/Xlib.h>

#include "linked_list.h"
#include "screen.h"


class WindowManagerException
{
public:
	WindowManagerException(){}
};


class WindowManager
{
public:
	WindowManager();
	~WindowManager();

	void start();
	void run();
	void stop();
	void quit();

	static void log(const char *str);
        
        void createNotify(XEvent *ev);
        void destroyNotify(XEvent *ev);
        void configureRequest(XEvent *ev);
	void mapRequest(XEvent *ev);
	void keyPress(XEvent *ev) ;
        
        WMScreen *getScreen(int id) const { return m_screens_list.at(id); }
        WMScreen *getCurrentScreen() const { return p_current_screen; }
        
private:
	static Logger m_log;
	bool m_is_running;
	LinkedList<WMScreen *> m_screens_list;
        WMScreen* p_current_screen;
        Display *p_display;
};

#endif
